﻿using System;
using System.Drawing;
using System.Windows.Forms;
using Map;
using Map_Creator.MapInfo;

namespace Map_Creator.AutoTileEditor
{
    public partial class AutoTile5Editor : Form
    {
        public AutoTileData TileResult;

        public AutoTile5Editor(TileSet set, AutoTileData tileData)
        {
            InitializeComponent();

            TileSetControl.Initialize(set);

            AutoTileDesigner.Initialize(tileData, set, TileSetControl, redoUndoStrip1);

            TileSetPanel.Width = set.TilesImage.Width + SystemInformation.VerticalScrollBarWidth;
            TileSetControl.Width = set.TilesImage.Width;
            TileSetControl.Height = set.TilesImage.Height;
            Size = new Size(TileSetPanel.Width + AutoTileDesigner.Right + 50, Size.Height);
        }

        private void SaveButton_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            TileResult = AutoTileDesigner.GetAutoTile();
        }
    }
}
